
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>构建高效的 CI/CD 流水线 - 学习卡片</title>
      <style>
        body { font-family: sans-serif; background-color: #f0f8ff; color: #333; display: flex; flex-direction: column; align-items: center; padding: 50px 20px; }
        .header h1 { font-size: 32px; }
        .grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; width: 100%; max-width: 1200px; }
        .card-container { perspective: 1200px; cursor: pointer; height: 250px; }
        .card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.7s; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
        .card-container.flipped .card { transform: rotateY(180deg); }
        .card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; display: flex; flex-direction: column; box-sizing: border-box; border-radius: 16px; background-color: #fff; padding: 24px; }
        .card-back { background-color: #f0fff4; transform: rotateY(180deg); justify-content: space-between; }
        .card-category { font-size: 14px; color: #0052d9; margin-bottom: 8px; font-weight: 500; }
        .card-question { font-size: 20px; font-weight: 500; flex-grow: 1; display: flex; align-items: center; justify-content: center; text-align: center; }
        .card-answer-wrapper { flex-grow: 1; overflow-y: auto; }
        .card-answer { font-size: 15px; line-height: 1.7; }
        .card-footer { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 16px; margin-top: 16px; }
        .card-source { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 12px; margin-top: 12px; }
      </style>
    </head>
    <body>
      <div class="header">
        <h1>构建高效的 CI/CD 流水线 - 学习卡片</h1>
      </div>
      <div class="grid-container">
        
    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">理论</div>
          <div class="card-question">持续集成（CI）的核心目标是什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">理论</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">持续集成的目标是确保每次代码变更后，都能自动化构建、测试和集成，从而尽早发现问题。</div>
          </div>
          <div class="card-source">来源: 一、CI/CD 的核心概念 > 1. 持续集成（CI）</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">理论</div>
          <div class="card-question">持续交付（Continuous Delivery）和持续部署（Continuous Deployment）之间最关键的区别是什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">理论</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">最关键的区别在于部署到生产环境的自动化程度。持续交付需要人工确认才能发布到生产环境，而持续部署则完全自动化，代码一旦通过所有测试就会自动发布。</div>
          </div>
          <div class="card-source">来源: 一、CI/CD 的核心概念 > 2. 持续交付（CD：Continuous Delivery） & 3. 持续部署（CD：Continuous Deployment）</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">实践</div>
          <div class="card-question">在设计CI/CD流水线时，如何实现“快速反馈”这一原则？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">实践</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">可以通过三种方式实现快速反馈：1. 采用增量构建，避免全量重新构建；2. 使用并行流水线加速测试执行；3. 提供详细的日志和错误报告以加快问题定位。</div>
          </div>
          <div class="card-source">来源: 二、CI/CD 流水线设计原则 > 2. 快速反馈</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">模式</div>
          <div class="card-question">为了降低生产环境的部署风险，文档中提到了哪两种部署策略？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">模式</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">文档中提到了蓝绿部署（Blue-Green Deployment）和金丝雀发布（Canary Release）这两种策略来降低部署风险。</div>
          </div>
          <div class="card-source">来源: 二、CI/CD 流水线设计原则 > 3. 隔离不同环境</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">实践</div>
          <div class="card-question">为了保障CI/CD流程的安全性与合规性，应集成哪些自动化安全措施？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">实践</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">应集成静态代码扫描（SAST）和动态安全测试（DAST）来防止安全漏洞。此外，还应实施代码审核和最小权限原则。</div>
          </div>
          <div class="card-source">来源: 二、CI/CD 流水线设计原则 > 4. 安全与合规</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">在Jenkins中，`Jenkinsfile`的作用是什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">`Jenkinsfile`是用来定义流水线（pipeline）的。它以代码的形式描述了从代码克隆、构建、测试到部署的完整流程和阶段。</div>
          </div>
          <div class="card-source">来源: 三、Jenkins 实现 CI/CD 流水线 > 1. Jenkinsfile 基本结构</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">特性</div>
          <div class="card-question">与Jenkins相比，GitHub Actions作为CI/CD工具有什么显著特点？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">特性</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">GitHub Actions的主要特点是无服务器（Serverless），用户无需自己维护CI/CD服务器。它会在代码变更时自动触发，并且特别适用于小型项目。</div>
          </div>
          <div class="card-source">来源: 四、GitHub Actions 实现 CI/CD > GitHub Actions 特点</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">实践</div>
          <div class="card-question">根据最佳实践，有哪些方法可以有效减少流水线的执行时间？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">实践</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">有两种主要方法可以减少执行时间：1. 采用缓存（Cache）技术，例如Maven或Gradle的构建缓存；2. 运行增量构建，只编译发生变更的代码。</div>
          </div>
          <div class="card-source">来源: 五、CI/CD 最佳实践 > 1. 减少流水线执行时间</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">什么是“Feature Flags（特性开关）”，它在自动化回滚场景下有什么作用？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">“Feature Flags（特性开关）”是一种可以动态控制功能开启或关闭的机制。在自动化回滚场景中，当部署出现问题时，可以利用它快速关闭新功能，避免问题影响所有用户，是自动化回滚策略的有效补充。</div>
          </div>
          <div class="card-source">来源: 五、CI/CD 最佳实践 > 3. 自动化回滚</div>
        </div>
      </div>
    </div>

      </div>
    </body>
    </html>
